package org.itboys.weixin.entity;

import org.mongodb.morphia.annotations.Entity;

/**
 * 微信账号和其他对象的关联关系 
 * @author 余颖芳
 * CREATE TABLE `weixin_rel` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `weixin_id` bigint(20) NOT NULL COMMENT '微信ID weixin_config表的主键',
  `rel_object_id` bigint(20) NOT NULL COMMENT '角色关联对象的ID',
  `rel_type` varchar(32) NOT NULL COMMENT '关联类型 比如 user:关联adminUser表',
  `creator` bigint(20) NOT NULL COMMENT '创建者ID',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `updater` bigint(20) NOT NULL COMMENT '修改者',
  `update_time` datetime NOT NULL COMMENT '最后修改时间',
  `is_deleted` tinyint(4) NOT NULL COMMENT '逻辑删除标记 1有效 0删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `weixin_id` (`weixin_id`),
  KEY `rel_object_id` (`rel_object_id`,`rel_type`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 COMMENT='微信和其他对象的 关联关系表';
 */
@Entity(value = "WeixinRel", noClassnameStored = true)
public class WeixinRel extends WeixinBaseEntity {

	private static final long serialVersionUID = -1261214475485504976L;
	
	private Long weixinId; //微信的ID
	private Long relObjectId;//微信关联对象的ID 视relType定
	private String relType;//微信关联对象的类型 比如 relType = user 就关联AdminUser
	public Long getWeixinId() {
		return weixinId;
	}
	public void setWeixinId(Long weixinId) {
		this.weixinId = weixinId;
	}
	public Long getRelObjectId() {
		return relObjectId;
	}
	public void setRelObjectId(Long relObjectId) {
		this.relObjectId = relObjectId;
	}
	public String getRelType() {
		return relType;
	}
	public void setRelType(String relType) {
		this.relType = relType;
	}
}
